package decorator;

public abstract class Decorator extends Beverage{
    public abstract void getDiscription();
}

class Mocha extends Decorator{
    Beverage beverage;

    public Mocha(Beverage beverage){
        this.beverage = beverage;
    }
    @Override
    public void getDiscription() {
        beverage.getDiscription();
        System.out.println("add Mocha");
    }

    @Override
    public double getCost() {
        return 20+beverage.getCost();
    }
}

class DarkRoast extends Decorator{
    Beverage beverage;

    public DarkRoast(Beverage beverage){
        this.beverage = beverage;
    }

    @Override
    public void getDiscription() {
        beverage.getDiscription();
        System.out.println("add Dark Roast");
    }

    @Override
    public double getCost() {
        return 10+beverage.getCost();
    }
}